package com.brodong.animal_remake.common.registers;
import com.brodong.animal_remake.Main;
import com.brodong.animal_remake.common.entities.monster.realization.*;
import com.brodong.animal_remake.common.entities.monster.render.*;
import net.minecraftforge.fml.common.Mod;

import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.EntityRenderersEvent;
import net.minecraftforge.event.entity.EntityAttributeCreationEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;

@Mod.EventBusSubscriber(modid = Main.MOD_ID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ClientModEventSubscriber
{

    //将所有的生物的皮肤贴图信息写在这个函数里，有几个写几个
    @SubscribeEvent
    public static void onRegisterLayers(EntityRenderersEvent.RegisterLayerDefinitions event) {
//        event.registerLayerDefinition(testModel.LAYER_LOCATION, testModel::createBodyLayer);
//        event.registerLayerDefinition(ZombieChangeModel.LAYER_LOCATION, ZombieChangeModel::createBodyLayer);
//        event.registerLayerDefinition(ZombieChangeModel.LAYER_LOCATION_IN, ZombieChangeModel::createINLayer);
//        event.registerLayerDefinition(ZombieChangeModel.LAYER_LOCATION_OUT, ZombieChangeModel::createOUTLayer);
//        event.registerLayerDefinition(FarmZombieModel.LAYER_LOCATION, FarmZombieModel::createBodyLayer);
    }

    //将所有的生物的渲染信息写在这个函数里，有几个写几个
    @SubscribeEvent
    public static void onRegisterRenderer(EntityRenderersEvent.RegisterRenderers event) {
        event.registerEntityRenderer(EntityRegister.GECKO_TEST.get(), GeckoTestRender::new);
        event.registerEntityRenderer(EntityRegister.MELEE_BASIC.get(), MeleeBasicRender::new);
        event.registerEntityRenderer(EntityRegister.FLYING_RANGE_BASIC.get(), FlyingRangeBasicRender::new);
        event.registerEntityRenderer(EntityRegister.REMOTE_BASIC.get(), RemoteBasicRender::new);
        event.registerEntityRenderer(EntityRegister.WITCH_BASIC.get(), WitchBasicRender::new);
        event.registerEntityRenderer(EntityRegister.FLY_MELEE_BASIC.get(), FlyMeleeBasicRender::new);
        event.registerEntityRenderer(EntityRegister.SKILL_BASIC.get(), SkillBasicRender::new);
    }

    //将所有的生物的属性信息写在这个函数里，有几个写几个
    @SubscribeEvent
    public static void onAttributeCreate(EntityAttributeCreationEvent event) {
        event.put(EntityRegister.GECKO_TEST.get(), GeckoTestEntity.prepareAttributes().build());
        event.put(EntityRegister.MELEE_BASIC.get(), MeleeBasicEntity.prepareAttributes().build());
        event.put(EntityRegister.FLYING_RANGE_BASIC.get(), FlyingRangeBasicEntity.createAttributes().build());
        event.put(EntityRegister.REMOTE_BASIC.get(), RemoteBasicEntity.prepareAttributes().build());
        event.put(EntityRegister.WITCH_BASIC.get(), WitchBasicEntity.prepareAttributes().build());
        event.put(EntityRegister.FLY_MELEE_BASIC.get(), FlyMeleeBasicEntity.prepareAttributes().build());
        event.put(EntityRegister.SKILL_BASIC.get(), SkillBasicEntity.prepareAttributes().build());
    }
}
